package fr.umlv.android.caveAVin.activities;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import fr.umlv.android.caveAVin.activities.R;
import fr.umlv.android.caveAVin.activities.R.id;
import fr.umlv.android.caveAVin.activities.R.layout;
import fr.umlv.android.caveAVin.beans.User;
import fr.umlv.android.caveAvin.sqlite.UserBDD;

public class ResumeCreateUser extends Activity  {

	Button continu;
	TextView resumeUserText;
	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.resume_create_user);
        
        continu = (Button) findViewById(R.id.Continue);
        resumeUserText = (TextView) findViewById(R.id.ResumeUser);
        Intent myLocalIntent = getIntent();
		// look into the bundle sent to Activity2 for data items
		Bundle myBundle = myLocalIntent.getExtras();
		
		User user = UserBDD.getUserWithLoginPass(myBundle.getString("login"), myBundle.getString("pass"));
		
		resumeUserText.setText(" login : "+user.getLogin() + " creer avec succes" );
		
		
		
		continu.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				Intent myIntentAuthentificationToCreateUser = new Intent(ResumeCreateUser.this,AuthentificationMenu.class);
				Bundle myData = new Bundle();
				myData.putBoolean("initBDD", false);
				startActivity(myIntentAuthentificationToCreateUser);
			}
		});
		
    }
}
